package com.example.mvvmdemo.http;

import com.example.mvvmdemo.AppConstants;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * User: Chentuisi
 * Date: 2023/8/7
 */
public class RetrofitBuilder {
    public static Retrofit get() {
        return new Retrofit.Builder()
                .baseUrl(AppConstants.API_REFERER)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
                .build();
    }

    public static Retrofit get(String baseUrl) {
        return new Retrofit.Builder()
                .baseUrl(baseUrl)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
                .build();
    }
}

